﻿using FireStarterModeller.BO;
using Habanero.Testability;

namespace FireStarterModeller.Test.BO
{
    public class TestUtilsUIGridFilter
    {
        public static BOTestFactory<UIGridFilter> GetFactory()
        {
            return BOTestFactoryRegistry.Instance.Resolve<UIGridFilter>();
        }
        /// <summary>
        /// Creates a new saved UIGridFilter with a random value assigned to every property
        /// </summary>
        public static UIGridFilter CreateSavedUIGridFilter()
        {
            UIGridFilter uIGridFilter = CreateUnsavedValidUIGridFilter();
            uIGridFilter.Save();
            return uIGridFilter;
        }

        /// <summary>
        /// Creates a new unsaved UIGridFilter with a random value assigned to every property
        /// </summary>
        public static UIGridFilter CreateUnsavedValidUIGridFilter()
        {
 /*           UIGridFilter uIGridFilter = CreateUnsavedValidUIGridFilter_WNoUIGrid();
            uIGridFilter.UIGridID = TestUtilsShared.CreateSavedUIGridInfo().UIGridID;
            return uIGridFilter;*/
            return GetFactory().CreateValidBusinessObject();
        } 
        /// <summary>
        /// Creates a new unsaved UIGridFilter with a random value assigned to every property
        /// </summary>
        public static UIGridFilter CreateUnsavedValidUIGridFilter_WNoUIGrid()
        {
            //UIGridFilter uIGridFilter = new UIGridFilter {Generated = TestUtilsShared.GetRandomBoolean()};
            //return uIGridFilter;
            return GetFactory().WithOutSingleRelationships().CreateValidBusinessObject();
        }
	    
        /// <summary>
        /// Creates a new unsaved UIGridFilter where all properties are null, except ID properties
        /// and those with default values.  If there are compulsory properties without
        /// defaults, saving the object will throw an exception.
        /// </summary>
        public static UIGridFilter CreateUnsavedDefaultUIGridFilter()
        {
            UIGridFilter uIGridFilter = new UIGridFilter();
            return uIGridFilter;
        }
    }
}